package com.caigou.bean.exam.entity;


import com.caigou.util.DateUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.util.Date;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Users {

  @JsonIgnore
  private Long id;
  //@JsonIgnore
  private String userid;
  private String tel;
  @JsonIgnore
  private String password;
  //@JsonIgnore
  private Long addTime;
  private Long userAuthRole;
  private Long userLevel;
  private Long userdate;
  private Long source;//注册来源  1app 2pc 3weixin 4考试中心 5微信小程序   6易找标  7湖北学员新增 8政府采购信息网官网
  private Long registerStyle;//注册方式 1手机 2微信 3qq 4微博 5微信小程序
  private String appToken;
  private String weixinToken;
  private String examToken;
  private String videoToken;
  private String pcToken;
  private Long isTel;
  private Long isWxuser;
  private Long isQquser;
  private Long isMicroblogUser;
  private Long isMarkUser;
  private String email;
  private String salt;
  private String deviceid;
  private String devicetype;
  private Long money;
  private Long integral;
  private Long userExp;
  private Long userExpLevel;
  private Long userStatus;

  private String strSource;//注册产品来源文本说明

  public String getStrSource(){
    if(source==1){
      strSource = "易采通App";
    }else if(source==2||source==5){
      strSource = "易考通";
    }else if(source==6){
      strSource = "易找标";
    }else if(source==8){
      strSource = "政府采购信息网官网";
    }else{
      strSource = "其他";
    }
    return strSource;
  }

  private String strRegisterStyle;//注册终端文本说明

  public String getStrRegisterStyle(){
    if(source==2&&registerStyle==1){
      strRegisterStyle = "PC端";
    }else if(registerStyle==1||registerStyle==5){
      strRegisterStyle = "手机";
    }else{
      strRegisterStyle = "其他";
    }
    return strRegisterStyle;
  }

  private String strAddTime;

  public String getStrAddTime(){
    if(addTime!=null){
      strAddTime = DateUtil.dateToString(new Date(addTime*1000), "yyyy-MM-dd HH:mm:ss");
    }else{
      strAddTime = "";
    }
    return strAddTime;
  }

  private String strUserdate;
  public String getStrUserdate(){
    if(userdate!=null){
      strUserdate = DateUtil.dateToString(new Date(userdate*1000), "yyyy-MM-dd HH:mm:ss");
    }else{
      strUserdate = "";
    }
    return strUserdate;
  }
  //one2one
  private UserInfo userInfo;


}
